#!/bin/bash

export S3_BUCKET="${s3_bucket}"
echo "export S3_BUCKET=\"$S3_BUCKET\"" >> /etc/environment

cd /home/ec2-user

# Install command line tools
sudo yum install -y aws git unzip aws-cli

# Setup data directory
sudo mkdir /home/ec2-user/data

# Download source repo
sudo -H -u ec2-user bash -c "yes | git clone https://github.com/azavea/raster-vision.git"

# Get docker container
`aws ecr get-login --region us-east-1`
docker pull 279682201306.dkr.ecr.us-east-1.amazonaws.com/raster-vision-gpu:latest
